package com.lzg.hechengfuyou;

/**
 * @Author lizhigang Date: 2019/9/8 22:47
 * @description: 非常典型的合成复用原则应用场景
 */
public class ProductDao {
    private DBConnection dbConnection;
    public void setDbConnection(DBConnection dbConnection){
        this.dbConnection = dbConnection;
    }
    public void addProduct(){
        String conn = dbConnection.getConnection();
        System.out.println("使用"+conn+"增加产品");
    }
}
